package com.cjm.one.system.client;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cjm.one.common.constant.ServerConstants;
import com.cjm.one.common.result.Result;
import com.cjm.one.model.base.BaseDeleteMoreVo;
import com.cjm.one.model.system.dto.SysPostDto;
import com.cjm.one.model.system.entity.SysPost;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(value = ServerConstants.SERVER_ONE_SYSTEM)
public interface SysPostClient {
    /**
     * @description: 分页条件查询岗位列表
     * @author: cjm
     * @date: 2024/10/8 22:08
     * @param: [dto]
     * @return: com.cjm.one.common.result.Result<com.baomidou.mybatisplus.extension.plugins.pagination.Page<com.cjm.one.model.system.entity.SysPost>>
     **/
    @PostMapping("/admin/system/post/list")
    @Operation(summary = "岗位列表")
     Result<Page<SysPost>> list(@RequestBody SysPostDto dto) ;

    @DeleteMapping("/admin/system/post/{id}")
    @Operation(summary = "根据id删除岗位")
     Result<Boolean> deleteById(@PathVariable("id") Long id) ;
    @GetMapping("/admin/system/post/{id}")
    @Operation(summary = "根据id查询岗位")
    Result<SysPost> getById(@PathVariable("id") Long id);
    @PostMapping("/admin/system/post")
    @Operation(summary = "新增岗位")
    Result<Boolean> save(@RequestBody SysPost sysPost);

    @PutMapping("/admin/system/post")
    @Operation(summary = "修改岗位")
    Result<Boolean> update(@RequestBody SysPost sysPost);

    @DeleteMapping("/admin/system/post/batch")
    @Operation(summary = "批量删除岗位")
    Result<BaseDeleteMoreVo> deleteBatchIds(@RequestBody List<Long> ids);
}
